# 练习一：年份更改
# 方法一：使用enumerate函数
ageList = [88, 89, 90, 98, 98, 0, 5, 75]
# 用法：用于在迭代循环中获取元素及其对应的索引
# 语法： enumerate(sequence,[start=0])
for index, value in enumerate(ageList):
    if value < 10:
        ageList[index] = f"200{value}"
    else:
        ageList[index] = f"19{value}"
print(ageList)

# 方法二：
ageList = [88, 89, 90, 98, 98, 0, 5, 75]
for index in range(0, len(ageList)):
    newAge = ageList[index]
    if newAge < 10:
        ageList[index] = f"200{newAge}"
    else:
        ageList[index] = f"19{newAge}"
print(ageList)